import React, {useEffect} from 'react';
import {
	Link, useLocation, useParams
} from "react-router-dom";

function Index(props) {
	const {pathname,search} = useLocation();
	const {a,b} = useParams();
	useEffect(()=>{
		console.log("新闻列表界面",search.slice(1))
	},[search])
	return (
		<div>
			newsList
			<Link to={{pathname:"/newsList"}}>一</Link>
			<Link to={"/newsList?id=2"}>二</Link>
			<Link to={{pathname:"/newsList",search:"id=3"}}>三</Link>
			<p>a:{a}</p>
			<p>b:{b}</p>
		</div>
	);
}

export default Index;